package day0724;

import java.util.Arrays;

public class Test10 {
    public static void main(String[] args) {
        int[] a={1,4,9,10};
        //
        for (int i = 0; i < a.length-1; i++) {
            if(a[i]  <  a[i+1]){
                //交换a[i]  <  a[i+1]
                int t=a[i];
                a[i]=a[i+1];
                a[i+1]=t;
            }
        }

        //[4, 9, 10, 1]
        for (int i = 0; i < a.length-1-1; i++) {
            if(a[i]  <  a[i+1]){
                //交换a[i]  <  a[i+1]
                int t=a[i];
                a[i]=a[i+1];
                a[i+1]=t;
            }
        }//[9, 10, 4, 1]


        for (int i = 0; i < a.length-1-2 ; i++) {
            if(a[i]  <  a[i+1]){
                //交换a[i]  <  a[i+1]
                int t=a[i];
                a[i]=a[i+1];
                a[i+1]=t;
            }
        }//[10, 9, 4, 1]

        System.out.println(Arrays.toString(a));
    }
}
